package crs.users.model;
// default package
// Generated 12-dic-2014 23:48:11 by Hibernate Tools 4.3.1

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * UserRoles generated by hbm2java
 */
@Entity
@Table(name = "user_roles", schema = "public", uniqueConstraints = @UniqueConstraint(columnNames = {
		"userid", "role" }))
public class UserRoles implements java.io.Serializable {

	private int userRoleId;
	private Users users;
	private String role;

	public UserRoles() {
	}

	public UserRoles(int userRoleId, Users users, String role) {
		this.userRoleId = userRoleId;
		this.users = users;
		this.role = role;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "user_role_id", unique = true, nullable = false)
	public int getUserRoleId() {
		return this.userRoleId;
	}

	public void setUserRoleId(int userRoleId) {
		this.userRoleId = userRoleId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "userid", nullable = false)
	public Users getUsers() {
		return this.users;
	}

	public void setUsers(Users users) {
		this.users = users;
	}

	
	@Column(name = "role", nullable = false, length = 45)
	public String getRole() {
		return this.role;
	}

	public void setRole(String role) {
		this.role = role;
	}

}
